# config.py - 完整的Spark和HDFS配置
import os

# ==================== Spark配置 ====================
# Spark Master地址
SPARK_MASTER = "local[*]"  # 默认使用本地模式

# 应用名称
SPARK_APP_NAME = "HDFS_Data_Processor"

# Spark资源配置
SPARK_DRIVER_MEMORY = "2g"
SPARK_EXECUTOR_MEMORY = "2g"
SPARK_EXECUTOR_CORES = "2"
SPARK_EXECUTOR_INSTANCES = "2"

# ==================== HDFS配置 ====================
# HDFS连接信息
HDFS_HOST = "192.168.71.128"  # 你的Ubuntu IP
HDFS_PORT = 9000
HDFS_WEB_PORT = 9870  # Hadoop 3.x使用9870，Hadoop 2.x使用50070
HDFS_USER = "keri"

# HDFS路径配置
HDFS_URL = f"hdfs://{HDFS_HOST}:{HDFS_PORT}"
DATA_PATH = "/zhipin"


# ==================== 数据源配置 ====================
# 数据文件格式
DATA_FORMAT = ["parquet", 'csv', 'json', 'orc']
# 字符编码
ENCODING = "utf-8"

# ==================== 日志配置 ====================
LOG_LEVEL = "INFO"
# ==========其他设置===========
SECRET_KEY='BOSS_ZHIPIN'
# ==================== 数据库配置 ====================
# MySQL数据库配置
MYSQL_HOST = 'localhost'
MYSQL_PORT = 3306
MYSQL_USER = 'root'
MYSQL_PASSWORD = '20040508'  # 替换为你的MySQL密码
MYSQL_DATABASE = 'boss_recruitment_system'

# SQLAlchemy配置
SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{MYSQL_USER}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False

# ==================== Flask配置 ====================
SECRET_KEY = 'BOSS_ZHIPIN_SECRET_KEY_2024'

# ==================== 其他配置 ====================
BCRYPT_LOG_ROUNDS = 12
# MODEL_PATH = "/models/salary_model"
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
MODEL_PATH = os.path.join(BASE_DIR, "model", "salary_model")